import request from "@/utils/request"

//获取社团列表
export function select(data){
  return request({
      method: 'POST',
      url: `/joinservice/join-clubs/getClubsByPage/${data.pageNum}/${data.pageSize}`,
      headers: {
        'Content-Type': 'application/json'
      },
      data
    }).then(res => res.data)
}

//根据id获取社团列表
export function selectId(clubId){
  return request({
      method: 'POST',
      url: `/joinservice/join-clubs/getClubs/${clubId}`,
      headers: {
        'Content-Type': 'application/json'
      },
    }).then(res => res.data)
}

//新增社团
export function add(data){
  return request({
      method: 'POST',
      url: '/joinservice/join-clubs/addOrSaveClubs',
      headers: {
        'Content-Type': 'application/json'
      },
     data
    })
}

//修改社团
export function update(data){
  return request({
      method: 'POST',
      url: '/joinservice/join-clubs/updateClubs',
      headers: {
        'Content-Type': 'application/json'
      },
     data
    })
}

//修改社团
export function del(clubId){
  return request({
      method: 'DELETE',
      url: `/joinservice/join-clubs/deleteClubsById/${clubId}`,
      headers: {
        'Content-Type': 'application/json'
      },
    })
}
